<?php

namespace Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity
 * @ORM\Table(name="sim")
 */
class Sim extends MappedSuperclassBase
{

    /**
     * @var string
     * @ORM\Column(type="string", length=32, unique=true, nullable=false)
     */
    protected $number;

    /**
     *
     * @var string
     * @ORM\Column(type="string", length=4, nullable=false)
     */
    protected $puk;

    /**
     *
     * @var datetime
     * @ORM\Column(type="datetime", name="date_create")
     * @Gedmo\Timestampable(on="create")
     */
    protected $dateCreate;

    /**
     * @var ArrayCollection
     * @ORM\OneToMany(targetEntity="SimOwner", mappedBy="sim", cascade={"persist", "remove"})
     */
    protected $users;

    /**
     * @var ArrayCollection
     * @ORM\OneToMany(targetEntity="Balances", mappedBy="sim")
     */
    protected $balances;

    /**
     *
     * @ORM\Column(type="boolean")     
     */
    protected $active;
    
    /**
     *
     * @var datetime
     * @ORM\Column(type="datetime", nullable= true)
     * @Gedmo\Timestampable(on="update")
     */
    protected $dateActive;

    function __construct()
    {
        $this->balances = new ArrayCollection;
        $this->users = new ArrayCollection;
        $this->dateActive = new \DateTime;
        $this->active = true;
    }

    public function getNumber()
    {
        return $this->number;
    }

    public function setNumber($number)
    {
        $this->number = $number;
    }

    public function getPuk()
    {
        return $this->puk;
    }

    public function setPuk($puk)
    {
        $this->puk = $puk;
    }

    public function getDateCreate()
    {
        return $this->dateCreate;
    }

    public function setDateCreate($dateCreate)
    {
        $this->dateCreate = $dateCreate;
    }

    /**
     *
     * @return ArrayCollection
     */
    public function getUsers()
    {
        return $this->users;
    }

    public function setUsers(ArrayCollection $users)
    {
        $this->users = $users;
    }

    /**
     *
     * @return ArrayCollection
     */
    public function getBalances()
    {
        return $this->balances;
    }

    public function setBalances(ArrayCollection $balances)
    {
        $this->balances = $balances;
    }

    public function getActive()
    {
        return $this->state;
    }

    public function setActive($active)
    {
        $this->active = $active;
    }
    
    public function getDateActive()
    {
        return $this->dateActive;
    }

    public function setDateActive($dateActive)
    {
        $this->dateActive = $dateActive;
    }

}
